﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="QueryTrainingCourseGroup.ascx.vb"
    Inherits="WebForm_ManageTrainingCourse_QueryTrainingCourseGroup" %>
<%@ Register Src="~/WebForm/CommonControl/AnnualControl.ascx" TagName="AnnualControl"
    TagPrefix="My" %>
<div align="left">
    <table>
        <tr>
            <td align="right">
                <asp:Label ID="lblAnnual" runat="server" meta:resourcekey="lblAnnual"></asp:Label>
            </td>
            <td align="left">
                <My:AnnualControl ID="AnnualControl1" runat="server" />
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="lblUOrganizationID" runat="server" Text="<%$ Resources:UOrganizationID %>"></asp:Label>
            </td>
            <td align="left">
                <asp:DropDownList ID="ddlUOrganizationID" runat="server" >
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="lblTrainingGroupName" runat="server" Text="<%$ Resources:lblTrainingGroupName.Text %>"></asp:Label>
            </td>
            <td align="left">
                <asp:TextBox ID="txtTrainingGroupName" runat="server"></asp:TextBox>
            </td>        
            <td align="left">
                <asp:Button ID="btnQuery" runat="server" Text="<%$ Resources:Query %>" />
            </td>
        </tr>
    </table>
    <asp:ObjectDataSource ID="ObjectDataSource_UOrganizationData" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="BLL_Select" TypeName="BLL_BLL_VOrganizationData"></asp:ObjectDataSource>
</div>
<br />
<My:MyGridView ID="GV" SkinID="pager" runat="server" DataKeyNames="Id" AllowHoverSelect="False"
    MySortDirection="Ascending" AutoGenerateColumns="False" EmptyDataText="<%$ Resources:EmptyData %>"
    AllowHoverEffect="False" AllowPaging="True" AllowSorting="True">
    <Columns>
        <asp:BoundField DataField="GroupName" HeaderText="<%$ Resources:GroupName %>" />
<%--        <asp:BoundField DataField="PersonLimit" HeaderText="<%$ Resources:PersonLimit %>" />
        <asp:BoundField DataField="Candidate" HeaderText="<%$ Resources:Candidate %>" />--%>
        <asp:TemplateField HeaderText="<%$ Resources:PersonLimit %>">
            <ItemTemplate>
                <%# Eval("PersonLimit") %> <%--/ <%# Eval("Candidate") %>--%>
            </ItemTemplate>
            
        </asp:TemplateField>        
        <asp:BoundField DataField="AllHour" HeaderText="<%$ Resources:AllHour %>" />
<%--        <asp:BoundField DataField="StartDate" HeaderText="<%$ Resources:StartDate %>" DataFormatString="{0:d}" SortExpression="StartDate" />
--%>        
        <asp:TemplateField HeaderText="<%$ Resources:StartDate %>" SortExpression="StartDate">
            <itemtemplate>
                <%#Eval("StartDate", "{0}")%>~<%#Eval("EndDate", "{0}")%>
            </itemtemplate>
            <itemstyle horizontalalign="Center" />
        </asp:TemplateField>        
        <asp:BoundField DataField="ClassPlace" HeaderText="<%$ Resources:ClassPlace %>" SortExpression="ClassPlace" />
        <asp:BoundField DataField="OrganizationName" HeaderText="<%$ Resources:OrganizationName %>" SortExpression="UOrganizationID" />
        <asp:BoundField DataField="Org" HeaderText="<%$ Resources:Org %>" SortExpression="Org" />
        <asp:TemplateField>
            <ItemTemplate>
                <asp:MultiView ID="mvForm" runat="server" ActiveViewIndex="0">
                    <asp:View ID="vwEdit" runat="server">
                        <asp:LinkButton ID="lbtnEdit" runat="server" Text="<%$ Resources:Edit %>" CommandName="Edit"></asp:LinkButton>
                    </asp:View>
                    <asp:View ID="vwSelect" runat="server">
                        <asp:LinkButton ID="lbtnSelect" runat="server" Text="<%$ Resources:Select %>" CommandName="Select"></asp:LinkButton>
                    </asp:View>
                </asp:MultiView>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        <asp:TemplateField ShowHeader="False">
            <ItemTemplate>
                <asp:LinkButton ID="lbtnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                    OnClientClick="<%$ Resources:DeleteConfirm %>" Text="<%$ Resources:Delete %>"  Visible='<%#Eval("IsDelete") %>'></asp:LinkButton>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
    </Columns>
</My:MyGridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
    SelectMethod="BLL_Select" TypeName="BLL_QueryTrainingCourseGroup" DeleteMethod="BLL_Delete">
    <DeleteParameters>
        <asp:Parameter Name="original_Id" Type="Int32" />
    </DeleteParameters>
    <SelectParameters>
        <asp:Parameter Name="UOrganizationID" Type="String" />
        <asp:Parameter Name="Annual" Type="String" />
        <asp:Parameter Name="TrainingGroupName" Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>
